#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

typedef struct s_option
{
  const char *identifier;
  int *flag;
} t_option;

int main(int ac, char **av)
{
  int all = 0;
  int player = 0;
  int manager = 0;
  int converters = 0;
  int i = 1;
  int j;
  t_option options[5] =
    {
      {"all", &all},
      {"player", &player},
      {"manager", &manager},
      {"converters", &converters},
      {NULL, 0}
    };

  while (av[i])
    {
      j = 0;
      while (options[j].identifier)
	{
	  if (!strcmp(av[i], options[j].identifier))
	    *options[j].flag = 1;
	  j++;
	}
      i++;
    }
  printf("all = %d\nplayer = %d\nmanager = %d\nconverters = %d\n", all, player, manager, converters);
  if (ac < 2)
    return (printf("Usage: build [all|player|manager|converters]\n"));
  return (0);
}
